<?PHP
	echo "Recreate table";
	$userName = "root";
	$password = "group05";
	$database = "test";
	$server = "cg3002-05-z.comp.nus.edu.sg";
	$dbHandle = mysql_connect($server, $userName, $password);
	$dbFound = mysql_select_db($database, $dbHandle);
	
	if ($dbFound) {
		$query = "drop table inventory;";
		$result = mysql_query($query);
		$query = "create table inventory
				(
					barcode int NOT NULL,
					product_name varchar(255) NOT NULL,
					cost_price float NOT NULL, 
					category varchar(255) NOT NULL,
					manufacturer varchar(255) NOT NULL,
					current_stock int NOT NULL,
					min_stock int NOT NULL,
					bun_unit int NOT NULL,
					PRIMARY KEY (barcode)
				);";
		$result = mysql_query($query);
	}
	else echo "Fail to create inventory";
?>